%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%openDACS projects%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Main optimization routine for A-IGZO TETs
%%% Print parameters or self-generate Verilog-A
%%% About a-IGZO devices and models,pls refer 10.1063/1.4922181,10.1109/TED.2021.3054359
%%% developed by Jingrui Guo,Lingfei Wang, and Ling Li from IME-CAS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function parms_print(coeff_op_final)
format long e
row_dim = length(coeff_op_final);
col_dim = 1;
format_string = cell(col_dim,1);
for nC = 1:col_dim
    format_string{nC} = ['%8e'];
end
% User prompt to enter file name with the correct path
outfile_name = ['print parms/parms.txt'];
fileID = fopen(outfile_name, 'w');
row_labels_final = cell(row_dim,1);
row_labels_final{1} = ['TA  [K]'];
row_labels_final{2} = ['Nt [/cm^2]'];     
row_labels_final{3} = ['n [unit-less]'];
row_labels_final{4} = ['m [unit-less]'];
row_labels_final{5} = ['ss [unit-less'];
row_labels_final{6} = ['Vfb [V]'];
row_labels_final{7} = ['Ue [Vs/cm^2]'];
row_labels_final{8} = ['y [unit-less]'];
row_labels_final{9} = ['ScaleVd [unit-less]'];
row_labels_final{10} =['ScaleVg [unit-less]'];
row_labels_final{11} =['FVd [unit-less]'];
for navg=1:row_dim
    fprintf(fileID, '%8s\t', row_labels_final{navg});
    fprintf(fileID, [format_string{:}, '\n'], coeff_op_final(navg,:));
end
fclose('all');
end